package com.github.xtranslation.core.repository;


import cn.hutool.core.collection.ListUtil;
import com.github.xtranslation.core.dto.TeacherDO;

import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class TeacherTransRepository implements TransRepository {

    @Override
    public Map<Object, Object>
    getTransValueMap(List<Object> transIdList, Annotation transAnno) {
        // 模拟数据库查询到的数据
        return ListUtil.of(
                new TeacherDO(1L, "1号老师", 1L),
                new TeacherDO(2L, "2号老师", 2L),
                new TeacherDO(3L, "3号老师", 3L),
                new TeacherDO(4L, "4号老师", 4L)
        ).stream().filter(x -> transIdList.contains(x.getId())).collect(Collectors.toMap(TeacherDO::getId, x -> x));
    }
}
